package com.rd.teacher.jichao.day16;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;

public class TestCollection {

    public static void main(String[] args) {
//        HashMap map = new HashMap();
//        Hashtable hashtable = new Hashtable();
//
//        Vector vector = new Vector();
//        Stack stack = new Stack();

        // 可以使用集合工具类中提供 的方法  获取线程安全的集合
        ArrayList arrayList = new ArrayList();
        List<Object> list = Collections.synchronizedList(arrayList);

        // 使用map的选择
        ConcurrentHashMap hashMap = new ConcurrentHashMap();
        CopyOnWriteArrayList list1 = new CopyOnWriteArrayList();
    }
}
